package mode23.builder;

/**
 * 指挥者，调用建造者中的方法完成复杂对象的创建。
 */
public class Director {
    private Builder builder = null;

    public Director(Builder builder) {
        this.builder = builder;
    }

    public Car construct() {
        builder.buildFrame();
        builder.buildEngine();
        builder.buildWheel();
        return builder.createCar();
    }
}
